package com.likersai.funa.controller;

import com.likersai.funa.pojo.dto.req.customer.CustomerReq;
import com.likersai.funa.pojo.dto.req.fundProduct.FundProductQueryReq;
import com.likersai.funa.pojo.entity.Customer;
import com.likersai.funa.pojo.entity.FundProduct;
import com.likersai.funa.pojo.vo.model.Page;
import com.likersai.funa.pojo.vo.model.Result;
import com.likersai.funa.service.FundProductService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 基金产品表(FundProduct)表控制层
 *
 * @author sun.ye
 * @since 2021-07-19 20:03:47
 */
@RestController
@RequestMapping("fundProduct")
public class FundProductController {
    /**
     * 服务对象
     */
    @Resource
    private FundProductService fundProductService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public FundProduct selectOne(Long id) {
        return this.fundProductService.queryById(id);
    }


    @PostMapping("queryPage")
    public Result<Page<FundProduct>> queryPage(@RequestBody FundProductQueryReq param){
        Page<FundProduct>  result = fundProductService.queryPage(param);
        return Result.getSuccess(result);
    }

}